import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const myLocale = ref("")
  const componentSize = ref('default')
  /**
   * 语言
   * @param value 语言
   */
  function setMyLocale(value:string) {
    myLocale.value = value
  }
  /**
   * 设置组件大小
   * @param value 组件大小
   */
  function setComponentSize(value:string){
    console.log(value)
    componentSize.value = value
  }

  return { myLocale, setMyLocale,componentSize,setComponentSize }
},{
  //对个人信息持久化
  persist: {
      key: "my_locale",
      storage: window.sessionStorage,
      paths: ["myLocale"],
  }
})
